home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbpong1a / intro.frm < prev    next >
Text File  |  1999-08-07  |  2KB  |  78 lines

  1. VERSION 5.00
  2. Begin VB.Form intro 
  3.    BorderStyle     =   0  'None
  4.    Caption         =   "Intro"
  5.    ClientHeight    =   4500
  6.    ClientLeft      =   0
  7.    ClientTop       =   0
  8.    ClientWidth     =   4500
  9.    LinkTopic       =   "Form1"
  10.    Picture         =   "intro.frx":0000
  11.    ScaleHeight     =   300
  12.    ScaleMode       =   3  'Pixel
  13.    ScaleWidth      =   300
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.Timer tmrUnload 
  17.       Interval        =   5000
  18.       Left            =   0
  19.       Top             =   0
  20.    End
  21. End
  22. Attribute VB_Name = "intro"
  23. Attribute VB_GlobalNameSpace = False
  24. Attribute VB_Creatable = False
  25. Attribute VB_PredeclaredId = True
  26. Attribute VB_Exposed = False
  27. Dim rgn As Long
  28. Dim bActive As Boolean
  29. Dim balls(0 To 3) As New ball
  30.  
  31. Private Sub Form_Click()
  32.     bActive = False
  33. End Sub
  34.  
  35. Private Sub Form_KeyPress(KeyAscii As Integer)
  36.     If KeyAscii = vbKeyEscape Then bActive = False
  37. End Sub
  38.  
  39. Private Sub Form_Load()
  40.     Me.Show
  41.     bActive = True
  42.     
  43.     For i = 0 To UBound(balls)
  44.         balls(i).SetXYVel Int(Rnd * 5) + 3, Int(Rnd * 5) + 3
  45.         balls(i).SetXY Int(Rnd * GetSystemMetrics(SM_CXSCREEN)) - 90, Int(Rnd * GetSystemMetrics(SM_CYSCREEN)) - 90
  46.     Next i
  47.  
  48.     SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
  49.     
  50.     rgn = CreateRoundRectRgn(0, 0, Me.ScaleWidth, Me.ScaleHeight, Me.ScaleWidth, Me.ScaleHeight)
  51.     SetWindowRgn Me.hWnd, rgn, True
  52.     
  53.     While (bActive)
  54.         DoEvents
  55.         
  56.         For i = 0 To UBound(balls)
  57.             balls(i).Move
  58.             balls(i).Update
  59.         Next i
  60.     Wend
  61.     
  62.     For i = 0 To UBound(balls)
  63.         balls(i).xit
  64.     Next i
  65.     
  66.     Unload Me
  67. End Sub
  68.  
  69. Private Sub Form_Unload(Cancel As Integer)
  70.     DeleteObject rgn
  71.     
  72.     Shell "VBPong.exe", vbNormalFocus
  73. End Sub
  74.  
  75. Private Sub tmrUnload_Timer()
  76.     bActive = False
  77. End Sub
  78.